package controllers;

import models.Granja;
import models.Usuario;
import play.data.validation.Required;
import play.db.jpa.GenericModel;

/**
 * Created with IntelliJ IDEA.
 * User: bicho
 * Date: 21/06/12
 * Time: 12:49
 * To change this template use File | Settings | File Templates.
 */
public class Security extends Secure.Security {

    public static void authenticate(@Required String username, String password, boolean remember) throws Throwable {
        Usuario usuario = Usuario.find("correoPassword", username, password).first();
        if (usuario != null) {
            session.put("username", usuario.correo);
        }
    }
}
